<%@ page language="java" pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/core/common/top.jsp" %>
<script src="${ctx}/core/scripts/jquery_last.js" type="text/javascript" charset="UTF-8"></script>
<script src="${ctx}/core/scripts/formValidator.js" type="text/javascript" charset="UTF-8"></script>
<script src="${ctx}/core/scripts/formValidatorRegex.js" type="text/javascript" charset="UTF-8"></script>
<html>
	<head>
		<title><s:text name='operator.operatorManage'/></title>
		<meta http-equiv="Pragma" content="no-cache">
		<meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0">
		<meta http-equiv="Expires" content="0">	
		<script>
			$(document).ready(function(){
				$.formValidator.initConfig({formid:"form0",tidymode:true,onerror:function(msg) {showMessage(msg);}});
				$("#loginName").formValidator().inputValidator({min:1,max:20,onerror:"<s:text name='operator.validate.loginName'/>",onerrormax:"<s:text name='operator.loginName.over.length'/>"});
				$("#name").formValidator().inputValidator({min:1,max:60,onerror:"<s:text name='operator.validate.name'/>",onerrormax:"<s:text name='operator.name.over.length'/>"});
				$("#pwd").formValidator().inputValidator({min:6,max:20,onerror:"<s:text name='operator.validate.pwd'/>",onerrormin:"<s:text name='operator.pwd.over.length'/>",onerrormax:"<s:text name='operator.pwd.over.length'/>"});
				$("#confirmPwd").formValidator().inputValidator({min:1,onerror:"<s:text name='operator.validate.confirmPwd.confirm'/>"}).compareValidator({desid:"pwd",operateor:"=",onerror:"<s:text name='operator.validate.confirmPwd.compare'/>"});
				$("input:checkbox[@name='roleArray']").formValidator().inputValidator({min:1,onerror:"<s:text name='operator.role.select'/>"});
			});
		</script>
	</head>
	<body>
		<form id="form0" action="systemManage/operatorManager.action" method="post" name="mainform">
			<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" valign="top">
				<%@include file="/WEB-INF/core/common/message.jsp"%>
				<tr width="100%">
					<td>
						<table border="0" align="center" cellpadding="0" cellspacing="0">
							<tr width="100%">
								<td width="8" height="27" align="left"><img src="${ctx}/core/images/button_05.gif" width="8" height="27" /></td> 
		    					<td width="99%"  align="left" background="${ctx}/core/images/button_06.gif" class="bluecu">&nbsp;<img src="${ctx}/core/images/icon_04.gif" />&nbsp;<s:text name="operator.operatorManage" /></td>
		    					<td width="8" align="right"><img src="${ctx}/core/images/button_07.gif" width="8" height="27" /></td>
		    				</tr>
		    			</table>
		    		</td>
		  		</tr>
				<tr>
					<td colspan="3" class="biaoge"  valign="top">
						<table width="100%" border="0" cellpadding="0" cellspacing="1" bordercolor="#FFFFFF">
							<tr align="left">
	      						<!--login name-->
        						<td width="15%" height="20" bgcolor="#DDE4EA" nowrap align="left">&nbsp;<s:text name='operator.loginName'/>&nbsp;<font color="red">*</font></td>
		        				<td nowrap width="35%" bgcolor="#DDE4EA" align="left">
		        					<exts:textfield id="loginName" name="operator.login" value="%{operator.login}" class="textbox_css" style="width:150px"/>
								</td>
								<!--姓名-->
        						<td width="15%" nowrap="nowrap" bgcolor="#DDE4EA" align="left">&nbsp;<s:text name='operator.name'/>&nbsp;<font color="red">*</font></td>
        						<td width="35%" bgcolor="#DDE4EA" align="left">
        							<exts:textfield id="name" name="operator.name" value="%{operator.name}" class="textbox_css" style="width:150px"/>
								</td>
      						</tr>
      						
      					<s:if test="pageState!='view'">
      						<tr align="left">
      							<!--密码-->
						        <td height="20" bgcolor="#DDE4EA" nowrap align="left">&nbsp;<s:text name='operator.password'/>&nbsp;<font color="red">*</font></td>
						        <td bgcolor="#DDE4EA" nowrap align="left">
						        	<input type="password" id="pwd" name="operator.password" value="<s:property value='%{operator.password}'/>"  class="textbox_css" style="width:150px"/>
								</td>
								<!--密码确认-->
						        <td bgcolor="#DDE4EA" nowrap align="left">&nbsp;<s:text name='operator.confirmPsw'/>&nbsp;<font color="red">*</font></td>
						        <td bgcolor="#DDE4EA" nowrap align="left">
						        	<input type="password" id="confirmPwd" name="confirmPsw" value="<s:property value='%{operator.password}'/>"  class="textbox_css" style="width:150px">
								</td>
							</tr>
						</s:if>
							<tr align="left">
							    <!--办公电话-->
							    <td height="20" bgcolor="#DDE4EA" nowrap align="left">&nbsp;<s:text name='operator.officePhone'/>&nbsp;</td>
							    <td bgcolor="#DDE4EA" nowrap align="left" colspan=3>
							    	<exts:textfield id="officePhone" name="operator.officePhone" value="%{operator.officePhone}" class="textbox_css" style="width:150px"/>
								</td>
								<!--操作员类型-->
								<!-- 
								<td height="20" bgcolor="#DDE4EA" nowrap align="left">&nbsp;<s:text name='operator.type'/>&nbsp;</td>
						        <td bgcolor="#DDE4EA" nowrap align="left">
						        	<s:if test="pageState!='view'">
										<select name="operator.operatorType" id="operator_operatorType">
    										<option value="superadmin" <s:if test="operator.operatorType=='superadmin'">selected</s:if>>超级管理员</option>
    										<option value="admin" <s:if test="operator.operatorType=='admin'">selected</s:if>>Administrator</option>
    										<option value="common" <s:if test="operator.operatorType=='common'">selected</s:if>>普通操作员</option>
										</select>						        	
									</s:if>
									<s:else>
										<s:text name="%{operatorTypeName}"/>
									</s:else>
								</td>
								-->
							</tr>
							<!--角色-->
							<tr>
								<td height="20" bgcolor="#DDE4EA" nowrap align="left">&nbsp;<s:text name='operator.role'/>&nbsp;<font color="red">*</font></td>
							    <td colspan="3" bgcolor="#DDE4EA" nowrap align="left">
									<s:if test="pageState!='view'">
										<exts:checkboxlist
											id="role"
											name="roleArray"
											list="roleList"
											listKey="id"
											listValue="name"
											labelposition="left"
											value="roleIdArray"/>
							        </s:if>
							        <s:else>
							        	<s:text name="%{roleView}"/>
							        </s:else>
							    </td>
							</tr>
							<tr>
								<td height="10" colspan="4" background="../core/images/line5.gif">&nbsp;</td>
							</tr>
							<tr>
								<td height="25" colspan="4" align="center">
									<s:if test="pageState=='add'">
							        	<input name="act" type="hidden" value="addSubmit"/>
							        </s:if>
							        <s:elseif test="pageState=='edit'">
							        	<input name="act" type="hidden" value="editSubmit"/>
							        	<input name="operator.id" type="hidden" value="<s:text name='%{operator.id}'/>"/>
							        </s:elseif>
						        	<input name="oldLoginName" type="hidden" value="<s:text name='operator.login'/>"/>
							        <s:if test="pageState!='view'">
										<input id="saveButton" type="submit" class="btn" value="<s:text name='button.save'/>"/>
									</s:if>  
							        <input id="returnButton" type="button" class="btn" value="<s:text name='button.return'/>" onclick="location='systemManage/operatorSearch.action?act=reQuery'"/>
								</td>
							</tr>
						</table>
    				</td>
				</tr>
			</table>
		</form>
	</body>
</html>